extends Node2D
@onready var login: CanvasLayer = $Login
@onready var user_name: LineEdit = $Login/Panel/HBoxContainer/VBoxContainer/UserName
@onready var pass_word: LineEdit = $Login/Panel/HBoxContainer/VBoxContainer/PassWord
@onready var submit: Button = $Login/Panel/HBoxContainer/VBoxContainer/Submit

func _ready() -> void:
	_init_signal()

func _init_signal() -> void :
	submit.button_up.connect(_init_nakama_link)

# 初始化Nakama连接
func _init_nakama_link() -> void :
	var result = await SceneManage._connect_server(user_name.text)
	if result :
		print(result.status_code)
		return
	get_tree().call_deferred("change_scene_to_file","res://scenes/main.tscn")
